package com.itheima.controller;


import com.itheima.domain.User;
import com.itheima.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Admin
 */
@Slf4j
@RestController
public class UserController {
    @Autowired
    UserService userService;

    @GetMapping("/user/findAllPlus")
    public List<User> findAll(){
        log.debug("log.debug执行了");
      return  userService.findAllPlus();
    }



    @GetMapping("/user/findById")
    @ResponseBody
    public User findById(long id){
        log.debug("log.debug执行了");
     return    userService.findById(id);
    }

}
